package com.wms.mapper;

import com.wms.domain.Dep;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DepMapper {

    @Select("select id, name, create_time, update_time from mybatis.dept")
    List<Dep> findAll();

    @Delete("delete from mybatis.dept where id = #{id}")
    void delete(int id);

    @Insert("insert into dept(name, create_time, update_time) value (#{name}, #{createTime}, #{updateTime})")
    void add(Dep dep);

    @Select("select id, name, create_time, update_time from dept where id = #{id}")
    Dep findByid(int id);

    @Update("update dept set name = #{name}, update_time = #{updateTime} where id = #{id}")
    void update(Dep dep);
}
